<template>
    <view class="mine" :class="me.loginUserType==$enums.RefreshToken_LoginType.集团 ? 'showTabar':'hideTabar'">
        <view class="mine-top">
            <view class="left-logo marr-20">
                <u-avatar :size="60"></u-avatar>
            </view>
            <view class="right-con">
                <view class="fz-38 cor00 marb-10 mart-10">{{ loginName }}</view>
                <view>
                    <text class="marr-10 fz-28 cor99">{{ name }}</text>
                </view>
            </view>
        </view>
        <view class="mine-main">
			<template v-if="me.loginUserType == $enums.RefreshToken_LoginType.集团">
				<view class="lis divCenterH" @click="kip('personalDetail')">
					<view class="divCenterH">
						<u-icon name="account" color="#2979ff" class="marr-20 por1" size="30"></u-icon>
						<text class="fz-30 cor28">个人信息</text>
					</view>
					<view>
						<u-icon name="arrow-right" color="#AEAEAE" size="24"></u-icon>
					</view>
				</view>
				<u-line color="#EEEFF1"></u-line>
			</template>
            <view class="lis divCenterH" @click="kip('editPassword')">
                <view class="divCenterH">
                    <u-icon name="edit-pen" color="#EEB173" class="marr-20 por1" size="30"></u-icon>
                    <text class="fz-30 cor28">修改密码</text>
                </view>
                <view>
                    <u-icon name="arrow-right" color="#AEAEAE" size="24"></u-icon>
                </view>
            </view>
            <u-line color="#EEEFF1"></u-line>
            <view class="lis divCenterH">
                <view class="divCenterH">
                    <u-icon name="info-circle" color="#2979ff" class="marr-28 por1" size="26"></u-icon>
                    <text class="fz-30 cor28">当前版本</text>
                </view>
                <view>
                    <text class="fz-30 cor82">{{ $config.Version }}</text>
                </view>
            </view>
        </view>
        <view class="footer-but">
            <u-button type="error" size="default" @click="show = true">退出登录</u-button>
        </view>
        <u-modal :show="show" content="是否确认退出？" @confirm="logOutShow" title="提示" :showCancelButton="true" @cancel='show = false'></u-modal>
    </view>
</template>

<script>
export default {
    data() {
        return {
			me:getApp().globalData,
            loginName: '',
            name: '',
            show: false,
        };
    },
    onShow() {
        this.loginName = getApp().globalData.loginName
        this.name = getApp().globalData.name
    },
    methods: {
        kip(type) {
            uni.navigateTo({
                url: '/pages/me/' + type,
            });
        },
        logOutShow() {
            uni.removeStorage({ key: this.$config.MeKey });
            uni.removeStorage({ key: this.$config.TokenKey });
            uni.reLaunch({
                url: '/pages/login/login'
            })
        }
    }
};
</script>

<style scoped>
.mine-top {
    display: flex;
    background-color: white;
    padding: 50rpx;
}

.mine-main {
    margin-top: 30rpx;
    background-color: white;
    padding: 0 30rpx;
    box-sizing: border-box;
}

.lis {
    height: 90rpx;
    justify-content: space-between;
}

.footer-but {
    padding: 0 30rpx;
    margin-top: 400rpx;
}
</style>
